<?php TPL::output('global/header.tpl.htm'); ?>

<?php if ($this->redirect_message) { ?>
<div class="rd_message">
<?php foreach ($this->redirect_message AS $key => $message) { ?>
	<p class="qs_reset"><?php echo $message; ?></p>
<?php } ?>
</div>
<?php } ?>

<div class="i_bd mainElem i_clear i_allbg" id ='qusetion_info_div'>
	<div class="i_left L_sidebar">
		<div class="q_congMain">
		<h2 class="i_prl">
			<?php echo $this->question_info['question_content']; ?>
			
			<div class="q_rightBar i_pas">
				<?php if ($this->user_id) { ?>
					<a href="javascript:;" onclick="focus_question($(this), $(this), <?php echo $this->question_id; ?>);" class="i_green_bt2 <?php if ($this->question_focus) { ?> cur<?php } ?>"><?php if ($this->question_focus) { ?>取消<?php } ?>关注</a>
					
					<a href="javascript:;" class="q_setBtn" onClick="$(this).siblings('.q_tipis').toggle();"></a>
					<div class="i_data_list i_pas q_tipis">
						<em class="i_arrows"></em>
						<?php if ($_GET['column'] == 'log') { ?>
						<p class="i_list_p"><a  href="question/<?php echo $this->question_id; ?>">站点讨论</a></p>
						<?php } else { ?>
						<p class="i_list_p"><a  href="question/id-<?php echo $this->question_id; ?>__column-log__rf-false">修改记录</a></p>
						<?php } ?>
						
						<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator'] OR (!$this->question_info['lock'] AND $this->user_info['permission']['redirect_question'])) { ?>
							<?php if ($this->question_info['redirect']) { ?>
								<p class="i_list_p"><a href="javascript:;" onclick="ajax_request(G_BASE_URL + '/question/ajax/redirect/', 'item_id=<?php echo $this->question_id; ?>');">撤消重定向</a></p>
							<?php } else { ?>
								<p class="i_list_p"><a href="javascript:;" onclick="$.startQs({flgs:6,seif:this});">站点重定向</a></p>
							<?php } ?>
						<?php } ?>
						<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?><p class="i_list_p"><a href="javascript:;" onclick="ajax_request(G_BASE_URL + '/question/ajax/lock/', 'question_id=<?php echo $this->question_id; ?>');"><?php if ($this->question_info['lock']) { ?>解除锁定<?php } else { ?>锁定站点<?php } ?></a></p><?php } ?>
					</div>
				<?php } ?>
			</div>
		</h2>
		
		<div class="q_topicManage">
			<span class="q_topicMuster" id="i_PublicTopic">
			  <span id ="q_info_tag_xx"> 标签</span>
				<?php foreach($this->question_topics as $key => $val){ ?>
				<a class="i_glotopic user_msg" data-message="&uid=<?php echo $val['topic_id'] ?>&card=topic" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a>
				<?php } ?>
			</span>
			<?php if ($this->user_id AND !$this->question_info['lock']) { ?><span class="q_editor i_small" title="标签编辑" onClick="$.topic.editor_topic({flg:this,make:false});" id="editor_topicBtns">标签编辑</span><?php } ?>
		</div>
			
		<div class="q_con_txt ">
			<!--  <div class="tags_Mark i_cl_01">
				<?php echo $this->question_info['question_detail']; ?>
			</div>-->
			<div class = "website_left" id = "website_left" style = "width:200px;height:150px;">
			<div id = "website_img"><a id="website_url" href="<?php echo 'http://'.$this->question_info['question_url']; ?>" url2="<?php echo 'http://'.$this->question_info['question_url2']; ?>"><img src="<?php echo  $this->question_info['question_img_url']; ?>" alt="" width="180" height="72" /></a></div>
			<div class="sep-10"></div>	
			</div>
	   <div class="website-right" id = "website-right">
        	<p>
            <span class="less-important">网址：</span><a id="website_url2" href="<?php echo 'http://'.$this->question_info['question_url']; ?>" url2="<?php echo 'http://'.$this->question_info['question_url2']; ?>" rel="nofollow" target="_blank" ><?php echo $this->question_info['question_url']; ?></a>
       		 </p>
      	  <p>
            	<span class="less-important">状态：</span><?php echo $this->question_info['statusInfo']; ?>  </p>
       	 <p>
            <span class="less-important">分类：</span><a href="home/explore/category-<?php echo $this->question_info['category_id']; ?>"><?php echo $this->question_info['categoryInfo']; ?> </a>        </p>

        <p>
            <span class="less-important">简介：</span><?php echo $this->question_info['question_detail']; ?>  </p>
         <p>
         
         <!--    评星插件 BEGIN    -->
         
        <div id="star" style ="width:150px;float:left"></div>
        <div id ="star_result" style ="float:left;width:300px;height:20px"><?php echo $this->question_score_str ?></div>
		
         <!--    评星插件 END   -->
         
         
           <!-- Baidu Button BEGIN -->
        <div id="bdshare" style="z-index:1;" class="bdshare_t bds_tools get-codes-bdshare">
		<span class="bds_more">分享到：</span>
		<a class="bds_qzone"></a>
		<a class="bds_tsina"></a>
		<a class="bds_tqq"></a>
		<a class="bds_renren"></a>
		<a class="bds_t163"></a>
		<a class="shareCount"></a>
		</div>
		<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=67312" ></script>
		<script type="text/javascript" id="bdshell_js"></script>
		<script type="text/javascript">
		document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
		</script>
		<!-- Baidu Button END -->
            </p>
            
           <?php if($this->user_id) { ?>
            <a id ="q_collect_link" class="q_collect" onclick="$.Q.favorite(<?php echo $this->question_info['question_id'];  ?>);" href="javascript:;">收藏<div id ="q_info_collect"></div></a>
            <?php } ?>
      	
    </div>
		  
		
			
			<?php if ($this->question_info['attachs']) {  ?>
			<p class="q_con_imgs i_alpHover">
				<?php foreach ($this->question_info['attachs'] AS $key => $attach) { ?>
				<?php if ($attach['is_image'] AND !in_array($attach['id'], $this->question_info['attachs_ids'])) { ?>
				<a href="<?php echo $attach['attachment']; ?>" target="_blank" data-fancybox-group="thumb" rel="lightbox"><img src="<?php echo $attach['attachment']; ?>" alt="<?php echo $attach['attach_name']; ?>" /></a>
				<?php } else if (!$attach['is_image']) { ?>
				<p class="q_accessory"><a href="<?php echo download_url($attach['file_name'], $attach['attachment']); ?>" class="i_gltxtHide"><em class="q_ico"></em><?php echo $attach['file_name']; ?></a></p>
				<?php } ?>
				<?php } ?>
			</p>
			<?php } ?>
		</div>
			
		<div class="q_bElems" id ="button_q_bElems">
		 <div id ="q_info_time"><?php echo date_friendly($this->question_info['add_time']); ?> </div>
		
		<!--  
		<div id = "q_info_comment"><?php if (!$this->question_info['lock'] || ($this->question_info['comment_count'] > 0)) { ?>
		<a href="javascript:;" class="q_criticism" onclick="toggle_comments(<?php echo $this->question_id; ?>, 'question',this,$.Q.reCallarrows);"><?php echo $this->question_info['comment_count']; ?> 条评论</a>
		<?php } ?>
		</div>-->
			
			<div id ="q_info_share">
			<span class="q_participate i_prl">
				<a href="javascript:;" class="q_pate">分享</a>
				<div class="i_data_list i_pas">
					
					<em class="i_arrows"></em>
					
					<p class="i_list_p">
						<a href="javascript:;"class="q_wb" onClick="$.startQs({flgs:2,number:0,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">站外</a>
					</p>
					<?php if ($this->user_id){ ?>
					<p class="i_list_p">
						<a href="javascript:;" class="q_letter" onClick="$.startQs({flgs:2,number:1,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">私信</a>
					</p>
					<?php } ?>
					<p class="i_list_p">
						<a href="javascript:;" class="q_maill" onClick="$.startQs({flgs:2,number:2,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">邮件</a>
					</p>
				</div>
			</span>
			</div>
			<div id ="q_info_edit">
			<?php if ((!$this->question_info['lock'] AND ($this->question_info['published_uid'] == $this->user_id OR $this->user_info['permission']['edit_question'])) OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?><a class="q_edit" href="publish/question_id-<?php echo $this->question_id; ?>#question">编辑</a><?php } ?>
			</div>
			<div id = "q_info_ip">
			<?php if (($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) AND $this->question_info['ip']) { ?><a href="javascript:;" title="<?php echo long2ip($this->question_info['ip']); ?>" onclick="$.alert('系统记录的 IP 地址为: <?php echo long2ip($this->question_info['ip']); ?>');" class="q_ip">IP 地址</a><?php } ?>
			</div>
			<div id ="q_info_to_edit">
			<?php if ($this->question_info['unverified_modify_count']) { ?><a href="question/id-<?php echo $this->question_id; ?>__column-log__rf-false" class="q_modification">待确认修改<em class="i_message_tooltip_s i_hide"><?php echo $this->question_info['unverified_modify_count']; ?></em></a><?php } ?>				
			</div>
			<div id ="q_info_fuck">
			<?php if ($this->user_id) { ?>
				<a class="q_help i_prl" href="javascript:;" onClick="$.startQs({flgs:8,report_type:'question', target_id:<?php echo $this->question_info['question_id']; ?>})">举报站点</a>
			<?php } ?>
			</div>
			
			<div id ="q_info_thx">
			<?php if ($this->user_id != $this->question_info['published_uid'] AND $this->user_id) { ?>
				<a class="q_grateful i_prl" href="javascript:;" <?php if (!$this->question_thanks) { ?> onclick="question_thanks(<?php echo $this->question_info['question_id']; ?>, this);"<?php } ?>><?php if ($this->question_thanks) { ?>已<?php } ?>感谢<?php if (!$this->question_thanks) { ?><span class="i_tips_black i_pas i_hide"><em></em>感谢提问者</span><?php } ?></a>
				<?php } ?>
			</div>
		</div>
			
		<!--评论_s-->
		<div class="i_commentElem i_prl" id="question_comments_<?php echo $this->question_info['question_id']; ?>" style="display:none">
			<em class="i_arrows"></em>
		    <div name="comments_list"></div>
		    <!--评论框_s-->
		    <?php if ($this->question_info['lock']) { ?>
		    <!-- 已锁定 -->
		    <?php } else if ($this->user_id) { ?>
		    <div id="save_question_comment_<?php echo $this->question_info['question_id']; ?>">
		    <form action="question/ajax/save_question_comment/question_id-<?php echo $this->question_info['question_id']; ?>" method="post">
		    <div class="i_Mits i_subBg">
		    	<textarea class="i_textArea" name="message" onFocus="$.focus(this,'评论一下...',$.Q.txtarea(this));">评论一下...</textarea>
		        <div class="i_subiv i_hide"><a href="javascript:;">取消</a><a href="javascript:;" onclick="save_comment(this);" class="i_gray_bt2">评论</a></div>
		    </div>
		    </form>
		    </div>
		    <?php } else { ?>
			<p style="padding:10px;">要评论站点请先<a href="account/login/">登录</a>或<a href="account/register/">注册</a></p>
			<?php } ?>
		    <!--评论框_e-->
		</div>
		<!--评论_e-->
		</div>
		
		<div class="b_restrain q_x2">
			<?php if ($_GET['column'] == 'log') { ?>
			<h3 class="latest_trendst_h3 q_qusAll i_prl q_content_h3 "><a class="v_more i_right" href="question/<?php echo $this->question_id; ?>">返回站点 »</a>站点修改日志</h3>
			<ul class="q_pagelogs" id="c_log_list"></ul>
			
			<p id="bp_log_more"><a class="i_ajax_more" href="javascript:;">更多...</a></p>
			<?php } else { ?>
			<h3 class="latest_trendst_h3 q_qusAll i_prl q_content_h3 ">
				<?php if ($this->answer_count) { ?>
				<p class="q_navC i_pas">
					<?php if ($this->user_id){ ?>
						<a href="question/id-<?php echo $this->question_id; ?>__uid-focus" <?php if ($_GET['uid'] == 'focus') { ?>  class="cur"<?php } ?>>关注的人</a>
						
						<a href="question/id-<?php echo $this->question_id; ?>__sort_key-add_time__sort-<?php if (($_GET['sort_key'] == 'add_time') && $_GET['sort'] == 'ASC') { ?>DESC<?php } else { ?>ASC<?php } ?>"<?php if ($_GET['sort_key'] == 'add_time') { ?> class="cur"<?php } ?>>时间<?php if (($_GET['sort_key'] == 'add_time') && $_GET['sort'] == 'DESC') { ?><em class="i_small q_arrs_down"></em><?php } else { ?><em class="i_small q_arrs_down q_arrs_up"></em><?php } ?></a>
						
						<a href="question/id-<?php echo $this->question_id; ?>__sort_key-agree_count__sort-DESC"<?php if ((!$_GET['uid'] && !$_GET['sort_key']) || $_GET['sort_key'] == 'agree_count') { ?> class="cur"<?php } ?>>票数</a>
					<?php } ?>
				</p>
				<?php } ?>
				
				<?php echo $this->answer_count; ?> 个回复
			</h3>
			
			<?php if ($this->answers) { foreach ($this->answers AS $key => $val) { ?>
			
			
			<?php if ($this->question_info['best_answer'] == $val['answer_id']) { ?><p class="winner_reply i_prl i_linkGreen"><em class="winner_Cup i_pas"></em>最佳回复</p><?php } ?>
			
			<div class="S_module q_replytxt " id ="q_info_answers_list" uninterested_count="<?php echo $val['uninterested_count']; ?>" force_fold="<?php echo $val['force_fold']; ?>" id="answer_list_<?php echo $val['answer_id']; ?>"><a name="answer_<?php echo $val['answer_id']; ?>"></a>
				<!--用户头像-->
				<?php if ($val['anonymous'] == 0) { ?><a class="s_user i_alpHover" href="people/<?php echo $val['url_token']; ?>"><img src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>"  class="user_msg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" /></a><?php } else { ?><a class="s_user i_alpHover" href="javascript:;"><img src="<?php echo G_STATIC_URL; ?>/common/avatar-mid-img.jpg" alt="匿名用户" title="匿名用户" /></a><?php } ?>
				
				<div class="s_txt i_prl">
					<p class="s_autograph i_gltxtHide"><?php if ($val['anonymous']) { ?>匿名用户<?php } else { ?><a  class="user_msg" data-message="&uid=<?php echo $val['uid']; ?>&card=user"  href="people/<?php echo $val['url_token']; ?>"><?php echo $val['user_name']; ?></a><?php if ($val['verified']) { ?> <em title="已认证" class="v i_small"></em> <?php } ?><?php if ($val['signature']) { ?> - <?php echo $val['signature']; ?><?php } ?><?php } ?></p>
					<p class="s_endorsepeople i_gray i_cl_02<?php if (!$val['agree_users']) { ?> i_hide<?php } ?>"><span class="g_txt">赞同来自:</span> <?php if ($val['agree_users']) { ?><?php $count = 0; foreach($val['agree_users'] AS $uid => $user) { ?><?php if ($count >= 5) { ?><em name="agee_people"<?php if ($count >= 5) { ?> style="display:none"<?php } ?>>、</em><?php } ?><a href="people/<?php echo $user['url_token']; ?>" data-id="<?php echo $uid;?>" class="user_msg" data-message="&uid=<?php echo $uid;?>&card=user" name="agee_people" <?php if ($count >= 5) { ?> style="display:none"<?php } ?>><?php echo $user['user_name']; ?></a><?php if (count($val['agree_users']) != ++$count && $count < 5) { ?><em>、</em><?php } ?><?php } ?><?php } ?><?php if (count($val['agree_users']) >= 5) { ?><a class="v_more" href="javascript:;" onclick="$(this).parent().find('[name=agee_people]').show();$(this).hide();">更多 »</a><?php } ?></p>
					
					<div class="i_txtBreak i_cl_01 tags_Mark"><?php echo FORMAT::parse_attachs($val['answer_content']); ?></div>
					
					<?php if ($val['attachs']) {  ?>
					<p class="q_con_imgs i_alpHover">
						<?php foreach ($val['attachs'] AS $attach) { ?>
						<?php if ($attach['is_image'] AND !in_array($attach['id'], FORMAT::parse_attachs($val['answer_content'], true))) { ?>
						<a href="<?php echo $attach['attachment']; ?>" target="_blank" data-fancybox-group="thumb" rel="lightbox"><img src="<?php echo $attach['attachment']; ?>" alt="<?php echo $attach['attach_name']; ?>" /></a>
						<?php } else if (!$attach['is_image']) { ?>
						<p class="q_accessory"><a href="<?php echo download_url($attach['file_name'], $attach['attachment']); ?>" class="i_gltxtHide"><em class="q_ico"></em><?php echo $attach['file_name']; ?></a></p>
						<?php } ?>
						<?php } ?>
					</p>
					<?php } ?>
					
					<div class="q_bElems">
						<?php echo date_friendly($val['add_time']); ?> 
						<?php if (!$this->question_info['lock'] || ($val['comment_count'] > 0)) { ?><a class="q_criticism" href="javascript:;" onclick="toggle_comments(<?php echo $val['answer_id']; ?>, 'answer',this,$.Q.reCallarrows);"><?php echo $val['comment_count']; ?> 条评论</a><?php } ?>
						<p class="q_hide">
							<?php if ($this->user_id != $val['uid'] AND $this->user_id) { ?>
							<a class="q_grateful i_prl" href="javascript:;" <?php if (!$val['user_rated_thanks']) { ?> onclick="answer_user_rate(<?php echo $val['answer_id']; ?>, 'thanks', this);"<?php } ?>><?php if ($val['user_rated_thanks']) { ?>已<?php } ?>感谢<?php if (!$val['user_rated_thanks']) { ?><span class="i_tips_black i_pas i_hide"><em></em>感谢热心的回复者</span><?php } ?></a>
							<?php } ?>
		
							<a class="q_pate" href="javascript:;" onclick="$.startQs({flgs:2,number:0,share_type:'answer',target_id:<?php echo $val['answer_id']; ?>});">分享</a>
						
						<?php if ($this->user_id) { ?>
							<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?>
							<a href="javascript:;" onclick="answer_force_fold(<?php echo $val['answer_id']; ?>, this);" class="q_help i_prl"><?php if ($val['force_fold']) { ?>撤消<?php } ?>折叠</a>
							<?php } else { ?>
							<a class="q_help i_prl" href="javascript:;" onclick="answer_user_rate(<?php echo $val['answer_id']; ?>, 'uninterested', this);"><?php if ($val['user_rated_uninterested']) { ?>撤消<?php } ?>没有帮助<span class="i_tips_black i_pas i_hide"><em></em>这是一个没有价值的回复</span></a>
							<?php } ?>
						<!--	<a class="q_collect" onClick="$.Q.favorite(<?php echo $val['answer_id']; ?>);" href="javascript:;">收藏</a>   -->
						
							<?php if (($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) OR ($val['uid'] == $this->user_id AND ((time() - $val['add_time']) < (get_setting('answer_edit_time') * 60) OR (!get_setting('answer_edit_time'))))) { ?>
							<a class="q_edit" href="javascript:;" onclick="$.startQs({flgs:5,anwsion_id:<?php echo $val['answer_id']; ?>});">编辑</a>
							<?php } ?>
						<?php } ?>
						</p>
					</div>
					
					<!--评论_s-->
			        <div class="i_commentElem i_prl" id="answer_comments_<?php echo $val['answer_id']; ?>" style="display:none">
			        	<em class="i_arrows"></em>
				        <div name="comments_list"></div>
			            <!--评论框_s-->
			            <?php if ($this->user_id) { ?>
			            <div id="save_answer_comment_<?php echo $val['answer_id']; ?>">
				            <form action="question/ajax/save_answer_comment/answer_id-<?php echo $val['answer_id']; ?>" method="post">
				            <div class="i_Mits i_subBg">
				            	<textarea class="i_textArea" name="message" onFocus="$.focus(this,'评论一下...',$.Q.txtarea(this));">评论一下...</textarea>
				                <div class="i_subiv i_hide"><a href="javascript:;">取消</a><a href="javascript:;" onclick="save_comment(this);" class="i_gray_bt2">评论</a></div>
				            </div>
				            </form>
			            </div>
			            <?php } else { ?>
						<p style="padding:10px;">要参与站点请先<a href="account/login/">登录</a>或<a href="account/register/">注册</a></p>
						    <div class="login_entrance login_bg_01 ">
				            	<?php if (get_setting('site_close') != 'Y' && (get_setting('sina_weibo_enabled') == 'Y' OR get_setting('qq_t_enabled') == 'Y' OR get_setting('qq_login_enabled') == 'Y')) { ?>
				            	其他登录：
				            	<?php if (get_setting('sina_weibo_enabled') == 'Y') { ?><a href="account/openid/sina/" class="sl i_small" title="新浪微博">新浪</a><?php } ?>
				            	
				            	<?php if (get_setting('qq_t_enabled') == 'Y') { ?><a href="account/openid/qq/" class="tx i_small" title="腾讯微博">腾讯微博</a><?php } ?>
				            	
				            	<?php if (get_setting('qq_login_enabled') == 'Y') { ?><a href="account/openid/qq_login/" class="qq i_small" title="QQ">QQ</a><?php } ?>
				            	<?php } ?>
				            </div>
						<?php } ?>
			            <!--评论框_e-->
			        </div>
			        <!--评论_e-->
			            
					<!--赞同数-->
					<?php if ($this->user_id AND $this->user_id != $val['uid']) { ?>
					<p class="s_xs i_pas">
						<a  onclick="$.I.addCast(this, G_USER_NAME, '<?php echo $val['answer_id']; ?>')" href="javascript:;" class="s_zt i_prl<?php if ($val['agree_status'] == '1') { ?> s_cur_z<?php } ?>"><span class="i_tips_black i_pas i_hide"><em></em>赞同回复</span></a>
						<em class="s" data-number="<?php echo $val['agree_count']; ?>"><?php echo $val['agree_count']; ?></em>
						<a data-id="38" onclick="$.I.oppCast(this,G_USER_NAME,'<?php echo $val['answer_id']; ?>')" href="javascript:;" class="s_fd i_prl<?php if ($val['agree_status'] == '-1') { ?> s_cur_f<?php } ?>"><span class="i_tips_black i_pas i_hide"><em></em>对回复持反对意见</span></a></p>
	                <?php } else { ?>
					<p class="s_xs i_pas">
	            		<a href="javascript:;" class="s_zt i_prl s_seif_z"></a>
	            		<em class="s"><?php echo $val['agree_count']; ?></em>
	            		<a href="javascript:;" class="s_fd i_prl s_seif_f"></a>
	                </p>
					<?php } ?>
				</div>
			</div>
			<?php } } ?>
			
			<!--被折叠_s-->
			<div class="S_module q_replytxt s_enpd" id="load_uninterested_answers" style="display: none;"><h4 class="s_enfoldment i_prl"><a href="javascript:;" class="a i_pas" onclick="$.alert('被折叠的回复是被大多数用户认为没有帮助的回复.');">为什么被折叠？</a><a href="javascript:;" onclick="$('#uninterested_answers_list').toggle();"><span class="hide_answers_count">0</span> 个回复被折叠</a></h4></div>
			
			<div style="display: none;" id="uninterested_answers_list"></div>
			<!--被折叠_e-->
		
			<?php echo $this->pagination; ?>
		
		<?php } ?>
		</div>
		
		<?php if ($_GET['column'] != 'log') { ?>
		<!--回复框_s-->
		<a name="answer_form"></a>
		<div class="i_replymainElem">
			<?php if ($this->question_info['lock']) { ?>
			<p align="center" style="padding:10px;">该站点目前已经被锁定，无法添加新回复</p>
			<?php } else if (!$this->user_id) { ?>
			<p align="center" style="padding:10px;">要回复站点请先<a id="question_login_str" href="account/login/">登录</a>

            	<?php if (get_setting('site_close') != 'Y' && (get_setting('sina_weibo_enabled') == 'Y' OR get_setting('qq_t_enabled') == 'Y' OR get_setting('qq_login_enabled') == 'Y')) { ?>            	​
            	<?php if (get_setting('sina_weibo_enabled') == 'Y') { ?><a id ="question_login_sl" href="account/openid/sina/" class="sl" title="新浪微博" >新浪微博</a><?php } ?>
            	
            	<?php if (get_setting('qq_t_enabled') == 'Y') { ?><a id ="question_login_tx" href="account/openid/qq/" class="tx" title="腾讯微博">腾讯微博</a><?php } ?>
            	
            	<?php if (get_setting('qq_login_enabled') == 'Y') { ?><a id ="question_login_qq" href="account/openid/qq_login/" class="qq" title="QQ">QQ</a><?php } ?>
            	<?php } ?>
			
			
			或<a  id="question_reg_str" href="account/register/">注册</a></p>
			
			  
			
			<?php } else if ($this->user_answered) { ?>
			<p align="center" style="padding:10px;">一个站点只能回复一次<?php if (get_setting('answer_edit_time')) { ?>，你可以在发言后 <?php echo get_setting('answer_edit_time'); ?> 分钟内编辑回复过的内容<?php } ?></p>
			<?php } else if ((get_setting('answer_self_question') == "N") && ($this->user_id == $this->question_info['published_uid'])) { ?>
			<p align="center" style="padding:10px;">不能回复自己发布的站点，你可以修改站点内容</p>
			<?php } else { ?>
			<form action="question/ajax/save_answer/" onsubmit="return false;" method="post" id="answer_form">
	        	<input type="hidden" name="post_hash" value="<?php echo new_post_hash(); ?>" />
	        	<input type="hidden" name="question_id" value="<?php echo $this->question_id; ?>" />
	        	<input type="hidden" name="attach_access_key" value="<?php echo $this->attach_access_key; ?>" />
	        	
				<h5 class="i_anony">
					<span class="i_right i_anonymity">
					<?php if (!$this->question_focus) { ?>
						<input type="checkbox" name="auto_focus" value="1" checked="checked" id="i_focus" title="关注站点" /><label for="i_focus">关注站点</label> &nbsp; 
					<?php } ?>
					<?php if (get_setting('anonymous_enable') == 'Y') { ?>
						<input type="checkbox" name="anonymous" value="1" id="i_anonymity" title="匿名回复" /><label for="i_anonymity">匿名回复</label>
					<?php } ?>
					</span>
					
					<p class="i_anUserhandle">
						<a href="people/" class="i_imgforUser"><img alt="<?php echo $this->user_info['user_name']; ?>" src="<?php echo get_avatar_url($this->user_info['uid'], 'mid'); ?>" /></a><b><a href="people/"><?php echo $this->user_info['user_name']; ?></a></b>
						<span class="i_reltxt i_gltxtHide"><?php echo $this->user_info['signature']; ?></span>
					</p>
				</h5>
				
				<div class="i_relayHandle">
	                <textarea name="answer_content" id="answer_content" class="i_textArea advanced_editor"><?php echo $this->draft_content['message']; ?></textarea>
					<p class="i_draft" id="answer_content_message"></a></p>
					<div class="i_acceMain i_prl" id="markItUpBtn">
                    	 <?php TPL::output('global/opencheck.tpl.htm'); ?> 	<!--显示微博同步选项-->	                  
						<div class="i_pas i_xAuto">
							<?php if ($this->human_valid) { ?>
							<span class="i_anthcode"><img id="captcha" onclick="this.src = G_BASE_URL + '/account/captcha/rnd-' + Math.floor(Math.random() * 10000);" src="" /><input type="text" onFocus="$.focus(this,'验证码');" value="验证码" name="seccode_verify" class="i_verification"/></span>
							<?php } ?>
							<a href="javascript:;" class="i_replay_but2" id="question_replay_submit" onclick="ajax_post($('#answer_form'));">回复</a>
						</div>
						
						<div class="i_uploadMain" id="file_uploader_answer"></div>
					</div>
				</div>
			</form>
			<?php } ?>
		</div>
		<!--回复框_e-->
		<?php } ?>
	</div>
	
	<div class="R_sidebar">
		<div class="i_rightMain">
		
			<!--    BEGIN -->
			<?php if(isset($this->ads_info)) { ?>
			<div id="site_push" class="interest_user">
			<div class="site_pic">
  				<a href ="<?php echo $this->ads_info['ad_url']?>"><img alt="<?php echo $this->ads_info['ad_title']?>" src="<?php echo $this->ads_info['ad_img_url']?>" style ="width:180px;height:180px"></a>
			</div>
			</div>
			<?php } ?>
			<!--  END -->
			
		
			<?php if ($this->question_info['anonymous'] == 0) { ?>
			<div class="interest_user">
				<h3>发起者</h3>
				<p class="q_xel">
					<a href="people/<?php echo $this->question_info['user_info']['url_token']; ?>" class="i_imgforUser"><img alt="<?php echo $this->question_info['user_info']['user_name'];?>" src="<?php echo get_avatar_url($this->question_info['published_uid'], 'mid'); ?>" class="user_msg" data-message="&uid=<?php echo $this->question_info['published_uid']; ?>&card=user" /></a>
					<a href="people/<?php echo $this->question_info['user_info']['url_token']; ?>" class="q_uname"><?php echo $this->question_info['user_info']['user_name']; ?></a><?php if ($this->question_info['user_info']['verified']) { ?> <em title="已认证" class="v i_small"></em> <?php } ?><?php if ($this->question_info['published_uid'] != $this->user_id AND $this->user_id) { ?><a href="javascript:;" onclick="follow_people($(this), $(this).find('em'), <?php echo $this->question_info['published_uid']; ?>);" class="i_add_attention<?php if ($this->user_follow_check) { ?> cur<?php } ?>"><em><?php if ($this->user_follow_check) { ?>取消<?php } ?>关注</em></a><?php } ?>
					<span class="q_spx"><?php echo $this->question_info['user_info']['signature']; ?></span>
				</p>
			</div>
			<?php } ?>
			
			<!-- 所属专辑 列表 -->
			<?php if (!empty($this->question_special_info_list)) { ?>
			<div class="interest_user">
				<h3>所属专辑</h3>
				<?php foreach($this->question_special_info_list as $special_info) { ?>
				<p class="q_xel">
					<a href="<?php echo  'special/explore/'.$special_info['id'] ?>" class="i_imgforUser"><img alt="<?php echo $special_info['title'] ;?>" src="<?php echo $special_info['img_url'] ?>" class="user_msg" /></a>
					<a href="<?php echo  'special/explore/'.$special_info['id'] ?>" class="q_uname"><?php echo $special_info['title']; ?></a>
				</p>
				<?php } ?>
			</div>
			<?php } ?>
			
				<!--   相关新闻 -->
			
			<?php 	if(isset($this->question_news_list) && is_array($this->question_news_list)) {
			 TPL::output('block/sidebar_question_news.tpl.htm');
				}
			 ?>
			
			<!-- ---end -->
			
			
			<!-- -- 相关网站  -->
			<?php if(is_array($this->question_relation_website)){ ?>
			<div class="interest_user" style="height:<?php echo count($this->question_relation_website)*35+35; ?>px;">
			  <h3>相关站点</h3>			  
			  <?php foreach($this->question_relation_website AS $key => $val) {?>
			  <p class="add_ls" id ="sidebar_website_list" >
			  <a href="<?php echo $val['url'] ?>"><img title="<?php echo $val['name'] ?>" src="<?php echo $val['img_url'] ?>" width=75 height=30></a>
			  </p>
			  <?php } ?>			
			</div>
			  <?php } ?>
			<!-- -相关网站end	 -->
			
			<?php if ($this->user_id AND !$this->question_info['lock']) { ?>
			<div class="interest_user">
				<h3>邀请别人回复</h3>
				<div class="q_invitation">
					<p class="q_tx" id="i_tabs"><a href="javascript:;">站内邀请<em class="i_message_tooltip_s"<?php if (count($this->invite_users) == 0){ ?> style="display:none;"<?php } ?> id="invi_User" rel="<?php echo count($this->invite_users); ?>"><?php echo count($this->invite_users); ?></em></a> • <a href="javascript:;">邮件邀请</a></p>
					<div class="tabs">
						<div class="editor_input rightSide i_hide" id="i_tabs_0">
							<p><input type="text" class="i_glotxtClass" value="仅限站内用户邀请..." id="invi_inputUser" data-rel="邀请" onKeyUp="$.I.searchUser(this,event,'search');$('#tips_err').hide();"  onfocus="$.focus(this,'仅限站内用户邀请...');"></p>
							<p style="color:red;height:30px; line-height:30px; text-align:left; display:none;" id="tips_err"></p>
							<ul id="invitation_user_list" class="invitation_user_list">
								<?php if ($this->invite_users) { ?>
								<?php foreach($this->invite_users as $key => $val){ ?>
								<li data-id="<?php echo $val['uid']; ?>"><a href="javascript:;" class="pic_xa i_left"><img class="user_msg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>"></a><?php if ($val['sender_uid'] == $this->user_id){ ?><a class="i_gray_bt2 i_right" href="javascript:;" data-id="<?php echo $val['uid']; ?>" onclick="$.disinvite_user(<?php echo $val['uid']; ?>,this,'<?php echo $val['user_name']; ?>')">取消邀请</a><?php } ?><span class="username_list" title="<?php echo $val['user_name']; ?>"><?php echo $val['user_name']; ?></span></li>
								<?php } ?>
								<?php } ?>
							</ul>
						</div>
						
						<div class="editor_input rightSide i_hide" id="i_tabs_1">
							<form id="email_invite_form" onSubmit="return false;" action="question/ajax/email_invite/question_id-<?php echo $this->question_id; ?>" method="post">
							<p>
								<input type="text" class="i_glotxtClass" value="邮件邀请回复..." id="invi_inputMail" data-rel="邀请" onKeyUp="$('#tips_err').hide();" name="email" onfocus="$.focus(this,'邮件邀请回复...');">
								<a title="邀请»" href="javascript:;" class="i_green_bt2" onclick="ajax_post($('#email_invite_form'));">邀请»</a>
							</p>
							</form>
						</div>
					</div>
					
					<?php if ($this->helpful_users) { ?>
					<div class="q_trt">
						<h4>可能帮到你的人</h4>
						
						<?php foreach ($this->helpful_users AS $key => $val) { ?>
						<p class="q_xel">
							<a href="people/<?php echo $val['url_token']; ?>" class="i_imgforUser"><img alt="<?php echo $val['user_name']; ?>" class="user_msg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>" /></a>
							<a href="javascript:;" class="i_right" onClick="$.invitation_user({fg:this,ex:'help',user:'<?php echo $val['user_name']; ?>',uid:<?php echo $val['uid']; ?>,url:'<?php echo get_avatar_url($val['uid'], 'mid'); ?>'})">邀请</a><span class="q_uname i_gltxtHide" style="max-width:90px;"><a href="people/<?php echo $val['url_token']; ?>"><?php echo $val['user_name']; ?></a></span>
							<span class="q_spx"><?php echo cjk_substr($val['signature'], 0, 12, 'UTF-8', '...'); ?></span>
						</p>
						<?php } ?>
					</div>
					<?php } ?>
				</div>
			</div>
			<?php } ?>
			
			<?php if ($this->question_related_list) { ?>
			<div class="interest_user">
				<h3>相关站点</h3>
				
				<div class="q_related_list">
				<?php foreach($this->question_related_list AS $key => $val) { ?>
				<a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a>
				<?php } ?>
				</div>
			</div>
			<?php } ?>
			
			<div class="interest_user">
				<h3>站点状态</h3>
				<div class="q_state">
					<p>最新活动：<span class="i_blue"><?php echo date_friendly($this->question_info['update_time']); ?></span></p>
					<p>浏览：<span class="i_blue"><?php echo $this->question_info['view_count']; ?></span> 次</p>
					<p>关注：<span class="i_blue"><?php echo $this->question_info['focus_count']; ?></span> 人</p>
					<p class="q_UserList" id="focus_users"></p>
				</div>
			</div>
			


		   </div>
	    </div>
   </div>

<script type="text/javascript">


$('#star').raty({
	hintList:  ['好烂呀', '不好用', 'soso啦', '不错哦', '给力，我喜欢'],
	path:"static/common/img",
	onClick: function(score) {
		set_score(score);
	  },
	  
	  
	  start:"<?php echo $this->question_info['question_score'] ?>",
	  showHalf:  true
	//target:'#star_result',
	//targetKeep:true

	
	
});

function set_score(score)
{
	var uid = "<?php echo $this->user_id ?>";
    if(uid  == 0)
    	{
    		alert('请先登录喲，亲');
    		location.href = G_BASE_URL + '<?php echo $this->acc_login_url; ?>';
    		return false;
    	}
	var arg = {
			'score':score,
			'question_id':"<?php echo $this->question_id ;?>",
			'uid':"<?php echo $this->user_id ?>"
	};
	$.post(G_BASE_URL + '<?php echo $this->update_score_url?>',arg , function(){
		
	});
	
	location.reload();

}

ATTACH_ACCESS_KEY = '<?php echo $this->attach_access_key; ?>';
ITEM_IDS = '<?php echo $_GET['item_id']; ?>';
COMMENT_UNFOLD = '<?php echo $_GET['comment']; ?>';
QUESTION_ID = <?php echo $this->question_id;?>;
UNINTERESTED_COUNT = <?php echo get_setting('uninterested_fold'); ?>;
//$.tabs('#i_tabs',$.exit_operate);
$.exit_operate('#i_tabs')

$(document).ready(function(){

	$('#website_url').bind('click',function(eve){
		 eve.preventDefault();
		  var url2 = $('#website_url').attr("url2");
		  
		  update_out_times();
		  window.open(url2,target='blank');
		});
	
	$('#website_url2').bind('click',function(eve){
		 eve.preventDefault();
		  var url2 = $('#website_url').attr("url2");
		  update_out_times();
		  window.open(url2,target='blank');
		});
		
});

function update_out_times()
{
	  // 更新 网站出口统计
	  var arg = {
			  'question_id':"<?php echo $this->question_id ;?>"
		};
	  $.post(G_BASE_URL + '<?php echo $this->update_out_times?>',arg , function(){
			
		});
}


</script>

<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/app/question_detail.js"></script>

<?php TPL::output('global/footer.tpl.htm'); ?>